<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
	<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
</head>

<body>
<form action="" method="post">
	手机号码： <input type="text" name="account" id="Account" /> 
	密码： <input type="password" name="password" />
	<input type="submit" value="提交" />
</form>

<script type="text/javascript">
$('#sendSmsCode').on('click', function () {
	var _this = this;
	$.post('{:U('Home/Public/sendSMSCode')}', {'type': 'register', 'mobile': $('#Mobile').val()}, function (data) {
		if(data.status == 1) {
			alert('发送成功');
			time(_this);
		} else {
			alert(data['msg']);
		}
	}, 'json');
});

function time(o) {  
    if (wait == 0) {  
        o.removeAttribute("disabled");            
        o.value="免费获取验证码";  
        wait = 60;  
    } else {  
        o.setAttribute("disabled", true);  
        o.value="重新发送(" + wait + ")";  
        wait--;  
        setTimeout(function() {  
            time(o)  
        },  
        1000)  
    }  
}  

</script>
</body>
</html>